-
Notifications
You must be signed in to change notification settings - Fork 108
Make sockets work on non-Linux Unix systems #1395
base: master
Are you sure you want to change the base?
Make sockets work on non-Linux Unix systems #1395
Conversation
@@ -32,6 +32,11 @@ config DETECT_BOARD_NAME | |||
config PLATFORM_LINUX | |||
bool | |||
|
|||
config PLATFORM_UNIX | |||
bool "unix" | |||
depends on HAVE_UNIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different indentation with line above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn. It didn't show because of 8-space tabs. My OS X's Emacs isn't properly configured for space mode.
looks good to me, just minor comments. I think we better merge this ASAP and work on details afterwards. |
Signed-off-by: Thiago Macieira <[email protected]>
A lot of the code that has so far been under PLATFORM_LINUX will actually work on generic Unix. Signed-off-by: Thiago Macieira <[email protected]>
Can we get this moving again. I'd like to see os x support getting in... @thiagomacieira how to you handle the sol_platform_* APIs. I get link errors when trying this patch. Don't see any activity in
|
@poussa: I had fixed all such errors. You need to either provide an implementation for those functions (dummy or not) or you need to make sure that their not called in the first place. The best solution for OS X (and iOS and Android and QNX and Windows, etc.) is to not compile sol-platform.c at all, since one won't be using Soletta to control the platform. It just happens that there's a lot of code leakage inside Soletta that requires functionality from sol-platform.c today, so I provided dummies instead to make the porting easier. |
For Sakari and Nodejs, the route Thiago was doing is okay. For OSX/Native and iOS where you want to be a guest part of an application, it doesn't make sense to use that route of us providing a mainloop and the likes. For these we should export native (ie: ObjC) modules that use Soletta internally, but it's not exposed. In iOS/OSX this would be a Framework where you compile with XCode and pick only the C files you need from Soletta. The "sol-mainloop-impl-ios.m", for instance, would use the current And as thiago said, export only what makes sense or what is missing in the platform. Like OIC is missing, MQTT, HTTP are not... I/O (GPIO, I2C...) are not possible, etc. This is a different case of what Thiago was doing, that is to run soletta applications in MacOS. This one we want Soletta as host main loop, similar to how Qt/Gtk does their porting. |
@thiagomacieira I don't see the sol_platform dummy functions anywhere. Where are they? I started to do that but wanted to ask since it seems the only viable solution. @barbieri My request for this PR has nothing to do with Node.js. I just want to run / debug soletta on OS X since that is my default env. Now I need to start VM (linux) every time I want to use soletta. That is, my request is to run soletta apps on OS X (MacOS). |
@poussa: the specific functions you're listing didn't exist when I wrote my patches. So you're not going to find the dummy functions anywhere. @barbieri: as far as I am concerned, this patch is done and was ready to be merged 2 months ago. Please take care of it. (don't ask me to resolve the merge conflict, I don't have time; it didn't conflict two months ago) |
I understood you'd merge it. Okay, I can ask someone in my team to merge and solve conflicts, but will need you to test the build on MacOS. @cabelitos can you rebase this branch and send a PR so @thiagomacieira can test? |
From @poussa's message, we know it doesn't compile anymore. Someone will need to add the missing functions. |
Most of the code was generic anyway, so move it to a "common" file. For the bits and pieces that were specific to Linux, reimplement in a generic version.
This patch series includes #1394.